//
//  User.swift
//  weibo
//
//  Created by yellow on 15/10/20.
//  Copyright © 2015年 yellow. All rights reserved.
//

import UIKit

/// 用户模型
class User: NSObject {
    /// 用户UID
    var id: Int = 0
    /// 用户昵称
    var screen_name: String?
    /// 用户头像地址（中图），50×50像素
    var profile_image_url: String?
    /// 是否是微博认证用户，即加V用户，true：是，false：否
    var verified: Int = 0
    /// 认证类型，-1：没有认证，0，认证用户，2,3,5: 企业认证，220: 达人
    var verified_type: Int = 0
    /// 会员等级 0-6
    var mbrank: Int = 0
    
    //kvc
    init(dict:[String:AnyObject]) {
        super.init()
        //kvc需要在运行时对已有的属性进行赋值，所以要先super.init()
        setValuesForKeysWithDictionary(dict)
    }
    
    //过滤掉网络穿过来多得数据
    override func setValue(value: AnyObject?, forUndefinedKey key: String) {
        
    }
    
    override var description:String{
        let keys = ["id","screen_name","profile_image_url","verified","verified_type","mbrank"]
        return  dictionaryWithValuesForKeys(keys).description
    }
    
    
}
